/*
*
* Created by yuri at Apr 2, 2011
*
*/



package implementation.server;

import java.util.Collection;

import implementation.shared.IPacket;
import implementation.shared.stubs.IPostStub;
import implementation.shared.stubs.IThreadStub;
import implementation.shared.stubs.IUserStub;

public interface IServer {
	
	//some of these need to be refactored so that the system doesn't need to handle or create IPackets.
	
	public IPacket validate(String username, String password);
	
	public IPacket register(String username, String password);
	
	public int getUserID(String username);
	
	// logout packet is returned from the session since the system closes the session afterwards (closes the connection)
	public void logout(int userID);

	public IPacket getAllForums();

	public IPacket addFriend(int userID, String friendName);

	public String getLastError();

	public boolean addForum(int _userID, String forumName);

	public Collection<IThreadStub> getAllThreads(int forumID);

	public Collection<IPostStub> getAllPosts(int threadID);

	public IThreadStub getThread(int threadID);

	public IPostStub getPost(int postID);

	public Collection<IUserStub> getFriends(int userID);

	public boolean addPost(int userID, int threadID, String topic, String content);

	public boolean addThread(int userID, int forumID, String topic, String content);

	public boolean editPost(int editorID, int postID, String topic, String content);

	public boolean removePost(int userID, int postID);
	
	public boolean removeThread(int userID, int threadID);
	
	public boolean removeFriend(int userID, int friendID);
	
}
